//
// Created by Tony on 2024/5/19.
//

#ifndef LEXER_PUNCT_TOKEN_H
#define LEXER_PUNCT_TOKEN_H

#include "Token.h"

namespace Lexer {

class PunctToken final : public Token {
    char value[4]{};

public:
    PunctToken(const Position& position, char p1, char p2 = '\0', char p3 = '\0')
        : Token(position), value{p1, p2, p3, '\0'} {}

    TokenType type() override { return TokenType::PUNCT; }

    const char* getValue() const { return value; }

    string toString() override { return string{value}; }
};

} // namespace Lexer

#endif // LEXER_PUNCT_TOKEN_H
